; by Jeremy Friesner. Miami support by Fredrik Rambris.
(transcript "On installing AMarquee...")
;Take a guess at which stack is installed...
(set DefaultSys 1) ; default to Miami...
(if (= (run "assign inet: EXISTS" (safe)) 0) (set DefaultSys 2)) ; or Inet225 if assign is there
(if (= (run "assign AmiTCP: EXISTS" (safe)) 0) (set DefaultSys 0)) ; or AmiTCP if assign is there
(set tcpsys
(askchoice
(prompt "Which TCP software do you wish to use AMarqueed with?")
(help @askdir-help)
(default DefaultSys)
(choices
"AmiTCP"
"Miami"
"Inet225"
"Other"
)
)
)
(set DaemonFileName "AMarqueed") ; default
(set LibraryFileName"amarquee.library") ; default
(set tcpname "(Unknown)") ; default
(set dbDir "") ; default
(select tcpsys
( ; for AmiTCP
(set servdir "AmiTCP:serv")
(set tcpname "AmiTCP")
(set dbDir "AmiTCP:db")
)
(
(set servdir "") ; for Miami--ask user
(set tcpname "Miami")
)
( ; for Inet225
(set servdir "Inet:serv")
(set tcpname "Inet225")
(set dbDir "Inet:db")
(set DaemonFileName "AMarqueed.inet225")
(set LibraryFileName "amarquee.library.inet225")
)
(set servdir "") ; for Other--ask user
)
(set InstallOpts
(askoptions
(
(prompt "Please indicate which parts of the AMarquee system you wish to install.")
(help "Which parts of the AMarquee system you should install depend on what you want to do with AMarquee on your system. Only install the AMarquee server if you wish to use your computer as a host for other Amigas to connect to with their AMarquee programs. Only install the AMarquee C include files if you wish to write your own AMarquee programs.")
(message "\nThis Installer script only knows how to install AMarqueed for AmiTCP, Inet225, or Miami. To install AMarqueed for another system, you will need to do it yourself. See the AMarquee installation documentation for what needs to be done for Miami, Inet225, or AmiTCP; your TCP stack will likely have similar requirements. This script can still install the other components of the AMarquee package, though.")
(
(if (= servdir "")
(set servdir ; Otherwise, Miami
(askdir
(prompt "Where do you want to put the AMarquee server executable, AMarqueed?")
(prompt "\n\nDo you wish to make AMarqueed resident in memory? This will save memory when multiple connections are active simultaneously.")
(help "Making a program resident causes AmigaDOS to keep its executable in memory permanently. When the program is run, instead of loading a new copy of the code into memory, the resident code is shared by the new process.")
(default 1)
)
)
)
(if (= makeResident 1)
(
(set InetDPath "AMarqueed")
(startup "AMarqueed"
(prompt ("\n\nOkay to put the line\n\nresident >NIL: %s pure\n\ninto your s:user-startup?" (tackon servdir "AMarqueed")))
(help "This line in your user-startup will load AMarqueed into memory so that it can be found when needed by inetd. If you choose not to add this line here, you will need to execute it somewhere else, or inetd will not be able to find AMarqueed and will refuse AMarqueed connections.")
(prompt "\n\nTo use AMarqueed with " tcpname ", the line:\n\nAMarquee 2957/tcp\n\nneeds to be present in your " dbDir "/services file. Do you wish me to update the file? (Note: AMarquee will not receive connections if this line is not precisely as shown above!)")
(help "The inclusion of this line into " dbDir "/services is done by an ARexx script which is smart enough to correctly edit previous installations. Also it will make a backup (to " dbDir "/services.bak) before writing.")
(confirm)
)
(if (not (exists "t:edit_text_succeeded") )
(message "The config file editing script (EditTextFile.rexx) did not complete successfully. You may need to edit your " dbDir "/services file yourself. Look in the 'Installation' section of the AMarquee docs for instructions.")
)
(delete "t:edit_text_succeeded")
(set userName "root")
(if (= tcpsys 2) (set userName "")) ; Inet225 doesn't have the username field
(prompt (cat "\nAlso, the line:\n\nAMarquee stream tcp nowait " userName " " InetDPath "\n\nneeds to be present in your " dbDir "/inetd.conf file. Do you wish me to update that file?\n(Note: AMarquee will not receive connections if this line is not precisely as shown above!)"))
(help "The inclusion of this line into " dbDir "/inetd.conf is done by an ARexx script which is smart enough to correctly edit previous installations. Also it will make a backup (to " dbDir "/inetd.conf.bak) before writing.")
(confirm)
)
(if (not (exists "t:edit_text_succeeded") )
(message "The config file editing script (EditTextFile.rexx) did not complete successfully. You may need to edit your " dbDir "/inetd.conf file yourself. Look in the 'Installation' section of the AMarquee docs for instructions.")
)
)
(
; Do config files for Miami: Create the textfile with a pointer to AMarqueed
; Add the lines to envarc:MiamiChangeDB (i.e. don't overwrite! Other programs
; may have their lines there too)
(run "type t:dbtemp >>envarc:MiamiChangeDB")
; If Miami is running... why not make it read the new settings?
(run "SYS:Rexxc/RX \"ADDRESS MIAMI.1;changedb\"")
; Clean up
(delete "t:dbtemp")
)
)
; set ENV vars if desired
(set ServerOpts
(askoptions
(prompt "There are several ENV variables AMarqueed looks at to determine limits on usage of your system. Please check the usage limitations you wish to enforce.")
(help "Each of these options will set for you an ENV variable. This variable will be copied into ENVARC: so that it will be retained after rebooting. To change the setting later, simply edit the file in ENVARC:, or use setenv and then copy the file from env: to envarc: when you are happy with it.")
(choices
"Limit memory used per connection"
"Specify minimum amount of memory to keep free"
"Limit number of connections per host"
"Limit total number of connections"
"Ban certain hosts or programs"
"Set AMarqueed's execution priority"
"Adjust idle-ping rate"
"Give special privileges to certain clients"
"Limit size of servers' message queues"
)
(default 0)
)
)
(if (BITAND ServerOpts 1)
(
; AMARQUEED_MAXMEM
(set AMarqueed_MaxMem
(asknumber
(prompt "\n\nSpecify the maximum amount (in kilobytes) of memory that each AMarquee connection may allocate. (Enter -1 to impose no individual allocation limit)")
(help "By setting this value, you can guarantee that no one AMarqueed process will dynamically allocate more than a certain amount of your RAM.")
(range -1 99999999999)
(default -1)
)
)
(textfile
(dest "ENVARC:AMARQUEED_MAXMEM")
(append AMarqueed_MaxMem)
)
)
)
(if (BITAND ServerOpts 2)
(
; AMARQUEED_MINFREE
(set AMarqueed_MinFree
(asknumber
(prompt "\n\nSpecify (in kilobytes) the minimum amount of memory that should be left free on your system at all times. (Enter -1 to impose no minimum free store restriction)")
(help "By setting this value, you can guarantee that no AMarqueed process will grab the last kilobytes of memory left in your system. Of course, this ENV variable cannot affect what other programs do...")
(range -1 99999999999)
(default -1)
)
)
(textfile
(dest "ENVARC:AMARQUEED_MINFREE")
(append AMarqueed_MinFree)
)
)
)
(if (BITAND ServerOpts 4)
(
; AMARQUEED_MAXCONN
(set AMarqueed_MaxConn
(asknumber
(prompt "\n\nSpecify the maximum number of simultaneous connections that any one Amiga may have to your AMarquee server. (Enter -1 to impose no maximum number of connections)")
(help "This setting will prevent any one client machine from hogging your system by opening too many connections.")
(range -1 99999999999)
(default -1)
)
)
(textfile
(dest "ENVARC:AMARQUEED_MAXCONN")
(append AMarqueed_MaxConn)
)
)
)
(if (BITAND ServerOpts 8)
(
; AMARQUEED_TOTALMAXCONN
(set AMarqueed_TotalMaxConn
(asknumber
(prompt "\n\nSpecify the total maximum number of simultaneous AMarquee connections that can exist on your system at once. (Enter -1 to impose no maximum number of connections)")
(help "By setting this value, you can guarantee that no more than (n) Amarquee connections will ever be active at once. Using this in combination with the AMARQUEED_MAXMEM ENV variable puts a finite limit on the total amount of your RAM that could be in use by Amarqueed at any one time.")
(range -1 99999999999)
(default -1)
)
)
(textfile
(dest "ENVARC:AMARQUEED_TOTALMAXCONN")
(append AMarqueed_TotalMaxConn)
)
)
)
(if (BITAND ServerOpts 16)
(
; AMARQUEED_BANNED
(set AMarqueed_banned
(askstring
(prompt "\n\nSpecify a regular expression to determine which hosts and/or programs should be banned from your computer. (Leave blank to impose no restrictions) The regular expression should be in the form /HostExp/ProgExp. See the Help for examples.")
(help "Examples: To ban all hosts from Australia, use /#?.au/#?. Or to ban all amarquee clients named Bob, use /#?/Bob. Or perhaps you have a list of things to ban: /(evil.hackers.com|sdcc8.ucsd.edu|fred.nerd.org)/#?")
(default "")
)
)
(textfile
(dest "ENVARC:AMARQUEED_BANNED")
(append AMarqueed_BANNED)
)
)
)
(if (BITAND ServerOpts 32)
(
; AMARQUEED_PRIORITY
(set AMarqueed_Priority
(asknumber
(prompt "\n\nSpecify the priority that AMarqueed daemons should execute at.")
(help "This is the standard Amiga priority system--lower priority programs get less CPU time when the system is busy, higher priority programs get more.")
(range -128 127)
(default -10)
)
)
(textfile
(dest "ENVARC:AMARQUEED_PRIORITY")
(append AMarqueed_Priority)
)
)
)
(if (BITAND ServerOpts 64)
(
; AMARQUEED_PINGRATE
(set AMarqueed_PingRate
(asknumber
(prompt "\n\nSpecify the number of minutes of idle time that should elapse before an idle-ping query is issued.")
(help "In order to ensure that all connections are still 'live', AMarqueed occasionally sends out an 'are you still there?' request to any client that hasn't been heard from for a while. Shorter ping rates cause a (very) slight extra demand on network and CPU usage, but cut down on the likelihood of 'dead' connections taking up memory.")
(range 1 99999999999)
(default 3)
)
)
(textfile
(dest "ENVARC:AMARQUEED_PINGRATE")
(append AMarqueed_PingRate)
)
)
)
(if (BITAND ServerOpts 128)
(
(set PrivOpts
(askoptions
(prompt "These settings allow you to give special abilities to machines or programs that you trust. These privileges could be abused by evil people, so don't give them out lightly!\n\nSPECIFY WHO MAY:")
(help "Each of these options will set for you an ENV variable. This variable will be copied into ENVARC: so that it will be retained after rebooting. To change the setting later, simply edit the file in ENVARC:, or use setenv and then copy the file from env: to envarc: when you are happy with it.")
(choices
"Kill (i.e. forcibly disconnect) other clients"
"Send system messages (i.e. 'wall' messages)"
"Change AMarqueed Settings & Env Variables"
"Do ALL of the above"
)
(default 0)
)
)
(if (BITAND PrivOpts 1)
(
; Kill Clients Privilege
(set AMarqueed_KillClients
(askstring
(prompt "\n\nSpecify a regular expression to determine which hosts and/or programs may kill other clients on your server. (Leave blank to not give this privilege to anyone) The regular expression should be in the form /HostExp/ProgExp. See the Help for examples.")
(help "Examples: To give this privilege to all computers from Australia, use /#?.au/#?. Or to give this privilege to all clients named Bob, use /#?/Bob. Or perhaps you have a list of things to this privilege to: /(localhost|sdcc8.ucsd.edu|fred.nerd.org)/#?")
(default "/localhost/#?")
)
)
(textfile
(dest "ENVARC:AMARQUEED_KILLCLIENTS")
(append AMarqueed_KillClients)
)
)
)
(if (BITAND PrivOpts 2)
(
; Send System Messages
(set AMarqueed_SendSysMessages
(askstring
(prompt "\n\nSpecify a regular expression to determine which hosts and/or programs may send 'system messages' on your server. (Leave blank to not give this privilege to anyone) The regular expression should be in the form /HostExp/ProgExp. (See help for info on what System Messages are).")
(help "'System Messages' are a special form of message that may be sent over AMarquee. They are meant to be used by the server administrator to send special messages (such as 'I'm shutting down the server now') to every client on the system.")
(default "/localhost/#?")
)
)
(textfile
(dest "ENVARC:AMARQUEED_SENDSYSMESSAGES")
(append AMarqueed_SendSysMessages)
)
)
)
(if (BITAND PrivOpts 4)
(
; Send System Messages
(set AMarqueed_Admin
(askstring
(prompt "\n\nSpecify a regular expression to determine which hosts and/or programs may change AMarqueed environment variables on your server. The regular expression should be in the form /HostExp/ProgExp. (Leave blank to not give this privilege to anyone) NOTE: IF A USER HAS THIS PRIVILEGE, HE IS ABLE TO ACQUIRE ALL OTHER PRIVILEGES AS WELL! (See help for examples).")
(help "Examples: To give admin privileges to all computers from Australia, use /#?.au/#?. Or to give full admin privileges to all clients named Bob, use /#?/Bob. Or perhaps you have a list of things to give privileges to: /(localhost|sdcc8.ucsd.edu|fred.nerd.org)/#?")
(default "/localhost/#?")
)
)
(textfile
(dest "ENVARC:AMARQUEED_ADMIN")
(append AMarqueed_Admin)
)
)
)
(if (BITAND PrivOpts 8)
(
; All special privileges
(set AMarqueed_AllPrivileges
(askstring
(prompt "\n\This parameter is a shortcut way to give certain clients ALL of the other privileges at once. Specify a regular expression to determine which hosts and/or programs should get all privileges on your server. (Leave blank to not give full privileges to anyone) The regular expression should be in the form /HostExp/ProgExp. See the Help for examples.")
(help "Examples: To give full admin privileges to all computers from Australia, use /#?.au/#?. Or to give full admin privileges to all clients named Bob, use /#?/Bob. Or perhaps you have a list of things to give privileges to: /(localhost|sdcc8.ucsd.edu|fred.nerd.org)/#?")
(default "/localhost/#?")
)
)
(textfile
(dest "ENVARC:AMARQUEED_ALLPRIVILEGES")
(append AMarqueed_AllPrivileges)
)
)
)
)
)
(if (BITAND ServerOpts 256)
(
; AMARQUEED_MAXQUEUEDMESSAGES
(set AMarqueed_MaxQueuedMessages
(asknumber
(prompt "\n\nSpecify the maximum number of internal messages that an AMarqueed daemon may have in its message queue, or -1 to leave it unlimited.")
(help "With this setting you can limit the size of each daemon's internal message queue; if the queue length exceeds the value you specify (due to perhaps a bad TCP connection), the daemon for that connection will be terminated and the connection closed. 50 is a good minimum value for this setting.")
(range 1 99999999999)
(default 50)
)
)
(textfile
(dest "ENVARC:AMARQUEED_MAXQUEUEDMESSAGES")
(append AMarqueed_MaxQueuedMessages)
)
)
)
(if (> ServerOpts 0)
(run "copy ENVARC:AMARQUEED_#? env:")
)
)
)
)
)
(if (BITAND InstallOpts 4)
(
; install AMarquee C includes
(set IncludeDir
(askdir
(prompt "Please indicate your C Amiga include directory. This is the directory that contains the clib, libraries, fd, and pragmas subdirectories for your C or C++ compiler.")
(help "The Installer script is now going to install header files into your Amiga include directory. The files to be installed include clib/amarquee_protos.h, libraries/amarquee.h, pragmas/amarquee_pragmas.h, and fd/amarquee.fd")
(default "include:amiga")
)
)
(copyfiles
(source "include/amiga")
(dest IncludeDir)
(all)
)
)
)
(if (BITAND InstallOpts 8)
(
; install AMarquee C++ wrapper class/headerfile
(set WrapperDir
(askdir
(prompt "Please indicate the directory to put the C++ header file Session.h:")
(help "No new directory will be created! Session.h contains a wrapper C++ class named Session, that lets you use amarquee.library in a more object-oriented fashion.")
(default "include:")
(newpath)
)
)
(copyfiles
(source "include/Session.h")
(dest WrapperDir)
)
)
)
(if (BITAND InstallOpts 16)
(
; install AMarquee PCQ includes
(set IncludeDir
(askdir
(prompt "Please indicate your PCQ include directory. This is the directory that contains the Intuition, Libraries, Resources, and other subdirectories for PCQ.")
(help "The Installer script is now going to install the header file AMarquee.i into the Libraries subdir of your PCQ include directory.")
(default "include:")
)
)
(copyfiles
(source "PCQ/AMarquee.i")
(dest (tackon IncludeDir "Libraries"))
(all)
)
; install AMarquee PCQ lib
(set LibDir
(askdir
(prompt "Please indicate where you would like the stub library, AMarquee.lib, to be put. One good place to keep it is in the same directory as PCQ.lib.")
(help "The Installer script is now going to install AMarquee.lib. AMarquee.lib is a link library with stub functions that call the corresponding functions in amarquee.library, on behalf of your PCQ program.")
(default "include:/")
)
)
(copyfiles
(source "PCQ/AMarquee.lib")
(dest LibDir)
(all)
)
)
)
(if (BITAND InstallOpts 32)
(
; install AMarquee docs
(set DocDir
(askdir
(prompt "Please indicate the directory to put the AMarquee.guide into:")
(help "No new directory will be created!")
(default "ram:")
(newpath)
)
)
(copyfiles
(source "AMarquee.guide")
(dest DocDir)
(infos)
)
)
)
(if (BITAND InstallOpts 64)
(
; install AMarquee example programs
(set ExampleDir
(askdir
(prompt "Please indicate the directory to create the ExamplePrograms directory in.") (help "A new directory named AMarqueeExamples will be created in the directory you specify.")